package com.cxj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cxj.domain.Ym;
import com.cxj.mapper.YmMapper;
import com.cxj.service.YmService;
import com.cxj.vo.SelectByYmNameRes;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author 宋小帅和李小美的computer
 * @description 针对表【ym】的数据库操作Service实现
 * @createDate 2025-02-04 10:03:28
 */
@Service
public class YmServiceImpl extends ServiceImpl<YmMapper, Ym>
        implements YmService {

    @Resource
    private YmMapper ymMapper;

    @Override
    public SelectByYmNameRes selectByYmName(String ymName) {
        SelectByYmNameRes selectByYmNameRes = ymMapper.selectByYmName(ymName);
        return selectByYmNameRes;
    }

    @Override
    public String insertNewYm(String VNAME ,String VIntroduction) {
        Boolean a = ymMapper.insertNewYm(VNAME , VIntroduction);
        if(a){
            return "新增成功";
        }else {
            return "新增失败";
        }
    }

    @Override
    public Boolean deleteYm(String VName) {
        Boolean res = ymMapper.deleteYm(VName);
        return res;
    }

    @Override
    public String UpdateYm(String VNAME, String VIntroduction) {
        Boolean a = ymMapper.UpdateYm(VNAME , VIntroduction);
        if(a){
            return "修改"+VNAME+"信息成功";
        }else {
            return "修改"+VNAME+"信息失败";
        }
    }
}




